<?php

namespace App\Http\Requests\Logic\Project;

use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;

class QueryCollection extends FormRequest
{
	/**
	 * 授权请求
	 *
	 * Date: 12/04/2018
	 * @author George
	 * @return bool
	 */
    public function authorize()
    {
    	$user = Auth::user();

    	if ($user->hasCompany() && $user->isManager()) {
    		return true;
		}
		return false;
    }

	/**
	 * 定义表单规则
	 *
	 * Date: 12/04/2018
	 * @author George
	 * @return array
	 */
    public function rules()
    {
        return [
        	'name' => 'nullable',
			'title' => 'nullable',
			'paginate' => 'nullable'
        ];
    }
}
